home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
graphic
/
postogrf.zip
/
POSTOGRF.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-08-10
|
63KB
|
1,625 lines
{$A+,B-,D+,E-,F-,I+,L+,N-,O-,R-,S-,V-}
{$M 32000,0,655360}
Program POSTogrf;
{ (O] SCRC Z; EXIT; }
{ Written by T. B. Passin in Turbo Pascal 5.0.
Writes labels onto graphs using Postscript laser printer. The labels
can be moved, sized, edited, and the font can be chosen. This
program takes as input the graph file from J. R. VanZandt's
graph program GRAPHLI, which is a version of GRAPH that puts
out a command file that drives the C. Itoh LIPS laser printer.
POSTOGRF also can read its own output file, the output from LIPSOGRF,
and the output from VanZandt's GRAPHPS.
POSTOGRF interactively adds labels to the file and outputs
a merged file containing both the graph and the labels ready to print
on a Postscript printer.
10 Aug 90 v6.14. Changes default font style when you change font.
4 June 90 v6.14x5.
31 May 90 v6.14x3 Now can also size CopyBlock automatically, or with
mover keys. Changed CopyBLock menu item function keys.
25 May 90 v6.14x2. Now has new mode: F8, moves Copyblock around
on page. Adjusted Copyblock defaults and positions of the VG
bar & MITRE Logo. Most changes are to Copybloc.inc. CopyBlock
now described in Postscript coords relative to origin. Added
types Rect, ScreenRect. Added var CopyBlock.
21 May 90 v6.14x1. Now rotates labels 90 deg. 2 new Postscript
words for this: 'rs' rotates and does 's', 'rsho' rotates and does
'show'.
2 May 90 v6.13e. 'X' option now autosaves without requesting
confirmation for output filename (omit save if unchanged).
25 Apr 90 v6.13d. Now defaults to 'y' for save when quitting. Added
'X' exit option: automatically saves file before quitting.
18 Apr 90 v6.13c. Minor fix for read-file message.
17 Apr90 v6.13b. Bug fix in init:split into init + init1, init1 comes
before ReadGRAPHLI. Initscrn now before ReadGRAPHLI; Now new labels
are spaced right in expanded viewing (fix AddLabel);
28 Mar 90 v6.13. Slightly increased default vertical spacing between
labels. Bug fix: after exiting a file without changing it,
a new file (no filename) no longer incorporates the previous one
(fixed Init, WritePrt); New file: label background now transparent.
Label background now defaults to most recent setting. ^-home, ^-end
now select head, tail of linked list, Home = PF6, End = PF8.
Now F10 to save/quit, new main menu.
18 Jan 90. v6.12. No confirmation needed to write to LPT3, COM3.
5 Jan 90. v 6.11. Now uses VGA mode: changes to init, initscreen.
}
Uses Graph, CRT, DOS,
Lipsfont, { BGI sansserif font }
lipsdrvr; { all the BGI drivers (except 3270) }
{$DEFINE POSTOGRF}
{$I pstrings.i}
{$I beboop.src}
{type db = array[1..100] of char;
dbPtr = ^db;}
Type Fontlist = (Times, TimesBold, Helv, HelvBold, Symbol,
MitreLogo);
paintType = (trans, opaque);
FontRec = record
{POSTabrv : string[6];}
FontNum : integer;
LipsStyle: Fontlist;
FontStr : string[80]; (* font descriptor *)
end; (* for reference only: *)
TextPtr = ^TextRec; (* TextSettingsType - record *)
{String80 = string[80];} (* Font : word; *)
TextRec = Record (* Direction : word; *)
Link: TextPtr; (* CharSize : word; *)
Tstr: string[80] ; (* Horiz : word; *)
CurrText: TextSettingsType ; (* Vert : word; end; *)
PrtSize: integer; (* in points *)
LipsFont: FontRec;
LabelBkGround: paintType;
end ;
String6 = string[6];
StyleNames = array [Times..MitreLogo] of string[20];
StyleAbrv = array [Times..MitreLogo] of string6 ;
Filearray = array[1..65000] of char;
Fileptr = ^Filearray;
ConfigRec = record
WriteMitreLogo: boolean;
DoBar: boolean;
end;
ExpandoRec = record
SF, {scale factor for expansion}
Xcent, {new screen center in original}
Ycent, {unscaled screen coordinates}
ScrnW, {1/2 new screen width}
ScrnH: integer; {1/2 new screen height}
end;
Rect = record
LLx, LLy, URx, URy, w, h: integer; end;
ScreenRect = record
ULx, ULy, LRx, LRy, sw, sh: integer; end;
PointRec = record x,y: integer; end;
LayoutRec = record
BoundingBox : Rect; {in points}
Origin : PointRec; {in 1/1000's}
Landscape, ChangeLayout: boolean;
end;
VideoColors = (mono,color);
GraphFileType = (GRAPHL, LIPSGRF, POSTSCRIPT, none);
OnOffType = (on, off);
type CBmodeType = (move, size);
const {Yes: set of char = ['Y','y'];}
UserDiv: byte = 100;
POSTStyleStr : StyleNames = ('Times-Roman', 'Times-Bold', 'Helvetica',
'Helvetica-Bold', 'Symbol', 'MitreLogo'{'Courier-Bold'});
UserStyleNames: StyleNames = ('Times', 'TimesBold',
'Helv', 'HelvBold', 'Symbol', 'MitreLogo' );
Ver: string80 = 'POSTogrf version 6.14';
JimDefFontStr = '/font1 /Helvetica-Bold findfont 181 scalefont def';
CharSizeAdjX = 35; { fudge factor to make screen label the same }
{ width as printed label }
defaultConfig: ConfigRec = (WriteMitreLogo: false; DoBar: false);
defaultBarY = 5100;
MitreLogoLabel: TextRec = (
Link : nil;
Tstr : 'MITRE';
CurrText: (
font : 100;
Direction : 0;
CharSize : 0;
Horiz : 0;
Vert : 0);
PrtSize : 20;
LipsFont: (
FontNum : 100;
LIPSStyle : MitreLogo;
FontStr : '');
LabelBkGround : opaque);
LogoX = 3800; LogoY = -275; {position of MITRE logo in thousandths}
{ ------------------ initial default font params -------------}
DefaultFsize:integer = 20;
DefaultLIPSStyle: fontlist = HelvBold;
{ESC = #27; BS = #8; CR = #13; LF = #10;}
Uparrow = #72; Downarrow = #80;
Leftarrow = #75; Rightarrow = #77;
Del = #83; Ins = #82;
{Home = #71; En = #79;} CNTLHome = #119; CNTLEnd = #117;
PF1 = #59; PF2 = #60; PF3 = #61; PF4 = #62; PF5 = #63;
PF6 = #64; PF7 = #65; PF8 = #66; PF9 = #67; PF10 = #68;
movers: set of char = [leftarrow, rightarrow, uparrow, downarrow,
Home, #115, #116, #73, #81];
{ ------------------------------------------------------------- }
pwhitespace : set of char = [#9, #10, #12, #13, ' ', ',', ';'];
printables: set of char =
['('..'+', '-'..':', '<'..'}', '!', '#'..'&'] ;
quotes: set of char = [#39,#34];
numbers: set of char = ['0'..'9','.'];
defaultLayout: LayoutRec = (
BoundingBox: (LLx: 0; LLy : 0; URx : 612; URy : 792;
w: 612; h : 792); {points}
Origin: (x :7375; y : 1500); {1/1000s in.}
Landscape : true;
ChangeLayout : false);
Var CurrSettings : TextSettingsType ;
TempText, SaveLastTextRec :